home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d968.lha / JustLook / Examples / ExampleSources / AmigaShell.jl.c next >
C/C++ Source or Header  |  1993-12-04  |  1KB  |  58 lines

  1. /* AmigaShell.jl  By Kamran Karimi.
  2.    
  3.    Should be linked with JustLook (© Kamran Karimi) routines.
  4. */
  5.     
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8. #include <intuition/intuition.h>
  9. #include <clib/exec_protos.h>
  10. #include <clib/dos_protos.h>
  11. #include <clib/intuition_protos.h>
  12.  
  13. #include "JustLook.h"
  14.  
  15. struct IntuitionBase *IntuitionBase;
  16.  
  17. #define Write_err printf("err = %08lx\n",err)
  18.  
  19. main()
  20. {
  21.  struct Window *win;
  22.  ErrorCode err;
  23.  struct ScrMap SM;
  24.  
  25.  IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0);
  26.  if(IntuitionBase == 0) exit(100);
  27.  
  28.  win = FindWindow("AmigaShell",NULL);
  29.  if(win > WIN_REPEATED) 
  30.  {
  31.   err = IEDisable(MOUSE|KBD); Write_err;
  32.   printf("Mouse and Keyboard disabled!\n");
  33.   Delay(50);
  34.   ActivateWindow(win);
  35.   WindowToFront(win);
  36.   InitSM(&SM,win->WScreen);
  37.   err = WinResize(&SM,win,RELATIVE,-30,-40); Write_err;
  38.   Delay(100);
  39.   err = WinDrag(&SM,win,RELATIVE,30,40); Write_err;
  40.   printf("press a mouse button to continue!\n");
  41.   err = IEWait(MOUSE);  Write_err;
  42.   WinAct(&SM,win,DEPTHWIN);
  43.   Delay(100);
  44.   WindowToFront(win);
  45.   Delay(25);
  46.   printf("That was all!\n");
  47.   err = IEEnable(MOUSE|KBD); Write_err;
  48.  }
  49.  else
  50.  {
  51.   if(win == WIN_REPEATED) printf("More than 1 AmigaShell window found!\n");
  52.   else printf("AmigaShell window not found!\n");
  53.   printf("Aborted...\n");
  54.  }
  55.  CloseLibrary((struct Library *)IntuitionBase);
  56.  exit(0);
  57. }
  58.